package other;

/**
 * @program: javase
 * @description: n求和
 * @author: lld
 * @create: 2021-05-04 22:20
 **/

class Offer16 {
    public static void main(String[] args) {
        System.out.println("sumNums(100) = " + sumNums(3));
    }
    static int res = 0;
    public static int sumNums(int n) {
        boolean x = n > 1 && sumNums(n - 1) > 0;
        res += n;
        return res;
    }
}
